Skip to main content

password

Type

property

Summary

Specifies a password that the user must enter before making changes to the stack.

Syntax

set the password of <stack> to {<passwordString> | empty}

Description

Use the password property to encrypt a stack's contents, allowing access only from within the application.

By default, the password property of newly created stacks is set to empty.

If the password property of a stack is not empty, all the text in the stack is encrypted (so that it cannot be read in another program, such as a text editor). Scripts, custom properties, text in fields or buttons, and object names in a password-protected stack are all encrypted. However, you can still open the stack, see the contents, and get object properties.

The password property applies to a stack, not to the entire stack file, so it is possible to have a stack file that contains both password-protected and unprotected stacks. After setting the password the password protection does not take effect until the stack has been removed from memory and reloaded.

If the password is set, the stack's Scripts cannot be modified, its password cannot be changed, and objects cannot be copied.

These restrictions stop operating temporarily for the current session when the stack's passKey property is set to the correct password by a handler.

To permanently remove the password restrictions, set the stack's password to empty.

Setting the password to empty removes the password from the stack and makes it fully accessible to any user.

note

Since all the text in a password-protected stack must be decrypted when the stack is opened, a password-protected stack takes longer to open than an unencrypted one, especially if the stack is large.

The password is encrypted when stored in the stack to prevent cracking the password protection. If you get the password of a stack, the property reports true if the stack has a password set and false otherwise.

note

Script only stacks are unable to be password protected. In order to password protect a script only stack use the following commands.

    set the scriptOnly of stack \"Secrets\" to false
set the password of stack \"Secrets\" to field \"Password\"
Important

password -protected stacks may cause some problems when opened in the LiveCode development environment. (For example, the Application Browser window cannot display properties of a password -protected stack.) If you want to set a password for stacks before you release them, the recommended method is to set the password on the Stacks screen of the Standalone Application Settings window.

Examples

set the password of stack "Secrets" to field "Password"
set the password of this stack to empty -- remove password

function: stacks, mcEncrypt

glossary: object, property, stack file, password, development environment, custom property, decrypt, Application Browser, Standalone Application Settings, script, encrypt, handler

keyword: string

object: button, field, stack

property: password, passKey

Compatibility and Support

Introduced

LiveCode 1.0

OS

mac

windows

linux

ios

android

Platforms

desktop

server

mobile

Thank you for your feedback!

Was this page helpful?